package com.googlecode.ozonbooksfinder.cairngormfinder.business
{
	import com.adobe.cairngorm.business.ServiceLocator;
	
	import mx.rpc.AsyncToken;
	import mx.rpc.IResponder;
	import mx.rpc.soap.WebService;
	
	public class BookFinderDelegate
	{
		private var responder : IResponder;
		private var service : WebService;
		
		public function BookFinderDelegate(responder:IResponder)
		{
			this.service = ServiceLocator.getInstance().getWebService("wsOzoneBookFinderService");
			this.responder = responder;
		}
		
		public function findItems(searchVal:String, searchContext:String) : void
		{	
			var call:AsyncToken = service.SearchWebService.send(searchVal, searchContext);
			call.addResponder(responder);
		}
	}
}